package com.bingwang.sourcelearn.aop;

import com.bingwang.sourcelearn.aop.invocationhandler.MyInvocationHandler;
import com.bingwang.sourcelearn.aop.service.UserService;
import com.bingwang.sourcelearn.aop.service.UserServiceImpl;
import org.springframework.cglib.proxy.Proxy;

/**
 * @author WangBing
 * @date 2023/11/19 12:13
 */
public class JdkProxyTestMain {
    public static void main(String[] args) {
        UserService userService =  (UserService) Proxy.newProxyInstance(JdkProxyTestMain.class.getClassLoader(), new Class[]{UserService.class},
                new MyInvocationHandler(new UserServiceImpl()));
        userService.deleteAll();
    }
}
